package file;

import java.io.File;
import java.io.IOException;

//当前项目目录下创建1.txt-100.txt文件
public class Test01 {
    public static void main(String[] args) throws IOException {
  /*      for (int i = 1; i <= 100; i++) {
            File f = new File("./" + i + ".txt");
            if (!f.exists()) {
                f.createNewFile();
                System.out.println("文件已创建");
            }else{
                System.out.println("文件已存在");
            }
        }*/
        for (int i = 0; i < 100; i++) {
            File f = new File(i + ".txt");
            if (!f.exists()){
                f.createNewFile();
                System.out.println("创建成功");
            }else{
                System.out.println("文件已存在");
            }
        }
    }
}
